<?php
	
	$p =$_REQUEST["p"];
	$con =mysqli_connect("localhost","root", "", "cqhg");
	mysqli_set_charset($con,"utf8");
	if($p=="1"){
		$pro ="select * from user limit 8";
		$prod =mysqli_query($con, $pro);
		$produ =mysqli_fetch_all($prod,MYSQLI_ASSOC);
		$str =json_encode($produ);
		echo $str;
	}
	if($p=="2"){
		$pro ="select * from scgy limit 2";
		$prod =mysqli_query($con, $pro);
		$produ =mysqli_fetch_all($prod,MYSQLI_ASSOC);
		$str =json_encode($produ);
		echo $str;
	}
	if($p=="3"){
		$dd=$_REQUEST["dd"];
		$pro ="select * from user where id='{$dd}'";
		$prod =mysqli_query($con, $pro);
		$produ =mysqli_fetch_all($prod,MYSQLI_ASSOC);
		$str =json_encode($produ);
		echo $str;
	}
?>